import { Component, OnInit } from '@angular/core';
import { ArticleListComponent } from '../article/list/article-list.component';
import { Article } from '../model/article';


@Component({
  selector: 'app-index',
  templateUrl: './index.component.html',
  styleUrls: ['./index.component.scss'],
  host: { class: 'w100 ' }
})
export class IndexComponent implements OnInit {
  articleList: Article[];
  constructor() { }
  ngOnInit() {
    this.articleList = [
      new Article().setProperties({
        id: 124,
        title: 'My blog is beginning today',
        prevText: 'i code it with angular, in the node envirenment',
        keywords: ['blog', 'angular'],
        addtime: '2018-05-16',
        viewCount: 259,
        prevImg: '../../assets/img/22.jpg'
      }),
      new Article().setProperties({
        id: 124,
        title: 'My blog is beginning today22',
        prevText: 'i code it with angular, in the node envirenment',
        keywords: ['blog', 'angular'],
        addtime: '2018-05-16',
        viewCount: 259,
        prevImg: '../../assets/img/33.jpg'
      }),
    ]

    // new Article().add({      
    //   title: 'My blog is beginning today22',
    //   prevText: 'i code it with angular, in the node envirenment',
    //   keywords: ['blog', 'angular'],
    //   addtime: '2018-05-16',
    //   viewCount: 259,
    //   prevImg: '../../assets/img/33.jpg',
    //   content:'here is the content'
    // })

  }




}
